﻿@{
    var stock = (Model.StockEntries as IEnumerable<dynamic>).FirstOrDefault();
    if(stock != null)
    {
        if(JDM.Decimal(stock.AdjustmentMin) > JDM.Decimal(stock.Reserve) &&
            !JDM.HasFlags(stock.Flags, "OversoldAllowed"))
        {
            <div class="hint">
                @T(Res.Name("Out"),
                    Svc.Numeric((decimal)JDM.Decimal(stock.Reserve)),
                    Svc.Numeric((decimal)JDM.Decimal(stock.AdjustmentMin)),
                    Svc.Numeric((decimal)JDM.Decimal(stock.AdjustmentMax)))
            </div>
        }
        else
        {
            <div class="hint">
                @T(Res.Name("In"),
                    Svc.Numeric((decimal)JDM.Decimal(stock.Reserve)),
                    Svc.Numeric((decimal)JDM.Decimal(stock.AdjustmentMin)),
                    Svc.Numeric((decimal)JDM.Decimal(stock.AdjustmentMax)))
            </div>
        }
    }
}